package com.megagoodsoftware.smugmug;

import java.util.ArrayList;



/**
 * A list of {@link com.megagoodsoftware.smugmug.google.android.photostream.Flickr.Photo photos}. A list
 * represents a series of photo on a page from the user's photostream, a list is
 * therefore associated with a page index and a page count. The page index and the
 * page count both depend on the number of photos per page.
 */
public class PhotoList {
    private ArrayList<Photo> mPhotos;
    private int mPage;
    private int mPageCount;

    public void add(Photo photo) {
        getPhotos().add(photo);
    }

    /**
     * Returns the photo at the specified index in the current set. An
     * {@link ArrayIndexOutOfBoundsException} can be thrown if the index is
     * less than 0 or greater then or equals to {@link #getCount()}.
     *
     * @param index The index of the photo to retrieve from the list.
     *
     * @return A valid {@link com.megagoodsoftware.smugmug.google.android.photostream.Flickr.Photo}.
     */
    public Photo get(int index) {
        return getPhotos().get(index);
    }

    /**
     * Returns the number of photos in the list.
     *
     * @return A positive integer, or 0 if the list is empty.
     */
    public int getCount() {
        return getPhotos().size();
    }

    /**
     * Returns the page index of the photos from this list.
     *
     * @return The index of the Flickr page that contains the photos of this list.
     */
    public int getPage() {
        return mPage;
    }

    /**
     * Returns the total number of photo pages.
     *
     * @return A positive integer, or 0 if the photostream is empty.
     */
    public int getPageCount() {
        return mPageCount;
    }

	public void setPage(int mPage) {
		this.mPage = mPage;
	}

	public void setPageCount(int mPageCount) {
		this.mPageCount = mPageCount;
	}

	public void setPhotos(ArrayList<Photo> mPhotos) {
		this.mPhotos = mPhotos;
	}

	public ArrayList<Photo> getPhotos() {
		return mPhotos;
	}
}